Try again to fix profiler setup
authorMatthias Clasen <mclasen@redhat.com>
Tue, 14 May 2019 20:09:44 +0000 (20:09 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 14 May 2019 20:09:44 +0000 (20:09 +0000)
We were trying to store the profiler_id
in a struct that does not exist at the time.
Store it somewhere else.

gtk/gtkapplication.c
gtk/gtkapplicationprivate.h

index 69e8e3b85cf91427d8119c3f10cd39b480ceda36..9b992f686d9f412baf4e2417709f00860e8cca7d 100644 (file)
@@ -168,6 +168,7 @@ typedef struct
   GtkActionMuxer  *muxer;
   GtkBuilder      *menus_builder;
   gchar           *help_overlay_path;
+  guint            profiler_id;
 } GtkApplicationPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkApplication, gtk_application, G_TYPE_APPLICATION)
@@ -689,8 +690,7 @@ gtk_application_dbus_register (GApplication     *application,
                                const char       *obect_path,
                                GError          **error)
 {
-  GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
-  GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) priv->impl;
+  GtkApplicationPrivate *priv = gtk_application_get_instance_private (GTK_APPLICATION (application));
   GDBusInterfaceVTable vtable = {
     sysprof_profiler_method_call,
     NULL,
@@ -710,7 +710,7 @@ gtk_application_dbus_register (GApplication     *application,
       g_dbus_node_info_unref (info);
     }
 
-  dbus->profiler_id = g_dbus_connection_register_object (connection,
+  priv->profiler_id = g_dbus_connection_register_object (connection,
                                                          "/org/gtk/Profiler",
                                                          org_gnome_Sysprof3_Profiler,
                                                          &vtable,
@@ -726,9 +726,9 @@ gtk_application_dbus_unregister (GApplication     *application,
                                  GDBusConnection  *connection,
                                  const char       *obect_path)
 {
-  GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) application;
+  GtkApplicationPrivate *priv = gtk_application_get_instance_private (GTK_APPLICATION (application));
 
-  g_dbus_connection_unregister_object (connection, dbus->profiler_id);
+  g_dbus_connection_unregister_object (connection, priv->profiler_id);
 }
 
 #else
index f167c7436298a061f398627bd335ddf04cdbe72f..24ef7c4a4021874fff36a79e1e64506b7810bc2a 100644 (file)
@@ -127,7 +127,6 @@ typedef struct
 
   gchar           *menubar_path;
   guint            menubar_id;
-  guint            profiler_id;
 
   /* Session management... */
   GDBusProxy      *sm_proxy;